<html>
<body bgcolor="#ffffff">
<h1>OpenPGP Tools Package</h1>

<font color="red">
<p><b>NOTE:</b>These tools are definitely in beta stage, they work for very specific instances
and may not work correctly for you</font>.
<font color="red">If there are issues, then report them on the dev-crypto@bouncycastle.org
mailing list.  Please read the options below, and please pay attention when options are not currently 
implemented.  For the short term expect these tools to change rapidly, and to be updated frequently in the
betas directory (<a href="http://www.bouncycastle.org/betas">http://www.bouncycastle.org/betas</a>)</p>
Thanks.
</font>
<p/>
<h3>PGPDump</h3> 
This tool is similar to the <b>gpg --list-packets</b> command. 
<p/>
<pre>
java org.bouncycastle.tools.openpgp.PGPDump [-K dir] [-skr file] [-pkr file] 
                                            [-P passphrase] [-pbe passphrase] filename
</pre>                                            
<p/>

<table border=1>
<tr><th width=30%>Option</th><th>Description</th></tr>
<tr><td>-K &lt;keyring dir&gt;</td><td>Specifies the directory containing the gpg keyring files.  These must
be called pubring.gpg and secring.gpg.  This should be sufficient for general use with gpg compatibility. 
Use the -pkr and -skr options to specify particular files. Using this option will generally require the -P
option when processing encrypted files.</td></tr>

<tr><td>-skr &lt;secretkeyring&nbsp;file&gt;</td><td>Specifies the file containing the gpg secret keyring file. 
This must be the full path to the file.  Using this option will generally require the -P option.</td></tr>

<tr><td>-pkr &lt;publickeyring&nbsp;file&gt;</td><td>Specifies the file containing the gpg public keyring file. 
This must be the full path to the file.</td></tr>

<tr><td>-P &lt;passphrase&gt;</td><td>Specifies the passphrase to unlock the secret keyring file.</td></tr>

<tr><td>-pbe &lt;passphrase&gt;</td><td>Specifies the passphrase to decrypt the file using the PGP PBE method.
(<font color="red">NOT TESTED</font>)</td></tr>

<tr><td>filename</td><td>The filename is the file to process.  This is required</td></tr>
</table>
<p/>
<b>NOTE:</b>  Combining options such as -K and -pkr will provide results that are unlikely to be useful.</font>

<h3>BCRampage</h3> 
This tool is similar to the <b>gpg</b> command.  This tool provides the capability to encrypt, decrypt, sign and 
verify PGP messages.  

<p/>
<pre>
java org.bouncycastle.tools.openpgp.BCRampage [ -e[a] | -d | -s | -v  ]
                                              [-K dir] [-skr file] [-pkr file] 
                                              [-R recipient]
                                              [-P passphrase] [-pbe passphrase]
                                              [-mdc] filename
</pre>
<p/>

<table border=1>
<tr><th width=30%>Option</th><th>Description</th></tr>
<tr><td>-e[a]</td><td>Encrypt [with ascii armour]</td></tr>
<tr><td>-d</td><td>Decrypt</td></tr>
<tr><td>-s</td><td>Sign (<font color="red">NOT IMPLEMENTED</font>)</td></tr>
<tr><td>-v</td><td>Verify (<font color="red">REQUIRES MORE TESTING</font>)</td></tr>
<tr><td>-K &lt;keyring dir&gt;</td><td>Specifies the directory containing the gpg keyring files.  These must
be called pubring.gpg and secring.gpg.  This should be sufficient for general use with gpg compatibility. 
Use the -pkr and -skr options to specify particular files. Using this option will generally require the -P
option when processing encrypted files.</td></tr>

<tr><td>-skr &lt;secretkeyring&nbsp;file&gt;</td><td>Specifies the file containing the gpg secret keyring file. 
This must be the full path to the file.  Using this option will generally require the -P option.</td></tr>

<tr><td>-pkr &lt;publickeyring&nbsp;file&gt;</td><td>Specifies the file containing the gpg public keyring file. 
This must be the full path to the file.</td></tr>

<tr><td>-P &lt;passphrase&gt;</td><td>Specifies the passphrase to unlock the secret keyring file.</td></tr>

<tr><td>-pbe &lt;passphrase&gt;</td><td>Specifies the passphrase to decrypt the file using the PGP PBE method.
(<font color="red">NOT TESTED</font>)</td></tr>

<tr><td>-R &lt;recipient&gt;</td><td>Specifies the recipient of the encrypted message.  This is normally the
email address of the recipient, however the matching is done using String.indexOf(), so any fragment that is
part of the user id attribute string for the key should work.</td></tr>

<tr><td>-mdc</td><td>If this option is specified, a PGP MDC (modification detection code) packet is added to the
encrypted file.  (So, use this with the -e option).The MDC packet contains a SHA-1 digest of the plaintext for comparison 
with the decrypted plaintext.</td></tr>

<tr><td>filename</td><td>The filename is the file to process.  This is required</td></tr>
</table>
<p/>
<b>NOTE:</b>  Combining options such as -K and -pkr will provide results that are unlikely to be useful.  Mixing options
or not providing options that might be needed (such as -e with -d, or -e and no -R) may result in NullPointerExceptions or
other strange errors.
</body>
</html>
</body>
</html>
